﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Elysium.Controls;
using Elysium.Demo.Configuracion.Empresa;
using SIIE_ERP.View;
using SIIE_ERP.Codigo;

namespace Elysium.Demo.Informes
{
    /// <summary>
    /// Lógica de interacción para Menu_Configuracion.xaml
    /// </summary>
    public partial class Menu_Informes : UserControl
    {
        private UsuarioActivo _sesion;

        public Menu_Informes(ref UsuarioActivo usuario)
        {
            InitializeComponent();
            this._sesion = usuario;
        }

        private void Button_Ventas_GpoClientes_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Viewbox Aux = (Viewbox)this.Parent;
                Aux.Child = null;
                Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Ventas/Grupos_Cliente.rdlc");
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
        }

        private void Button_Compras_GpoProveedores_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Compras/Grupos_Proveedores.rdlc");
        }

        private void Button_Bancos_CuentasBancarias_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Bancos/Cuentas_Bancarias.rdlc");
        }

        private void Button_Bancos_TarjetasCredito_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Bancos/Tarjetas_Credito.rdlc");
        }

        private void Button_Bancos_FormasPago_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Bancos/Formas_Pago.rdlc");
        }

        private void Button_Bancos_TipoMovBancario_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Bancos/Tipos_Mov_Banco.rdlc");
        }

        private void Button_PuntoVenta_Terminales_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Punto_Venta/Terminales.rdlc");
        }

        private void Button_Inventarios_Almacen_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Almacenes.rdlc");
        }

        private void Button_Inventarios_UnidadesMedida_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/UM.rdlc");
        }

        private void Button_Inventarios_GpoProductos_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Grupos_Producto.rdlc");
        }

        private void Button_Inventarios_SubGpoProductos_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/SubGrupos_Producto.rdlc");
        }

        private void Button_Inventarios_Lineas_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Lineas_Producto.rdlc");
        }

        private void Button_Inventarios_TiposMovimientosInventario_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Tipos_Mov_Inventario.rdlc");
        }

        private void Button_CRM_Campanas_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/CRM/Campana.rdlc");
        }

        private void Button_CRM_TipoActividad_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/CRM/Tipo_Actividad.rdlc");
        }

        private void Button_CRM_Competidor_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/CRM/Competidor.rdlc");
        }

        private void Button_Ventas_Cotizaciones_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas(ref _sesion, "Informes/Reportes/Operativos/Ventas/Cotizaciones.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_CotizacionVenta);
        }

        private void Button_Ventas_Pedidos_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas(ref _sesion, "Informes/Reportes/Operativos/Ventas/Pedidos.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_Pedido);
        }

        private void Button_Ventas_Remisiones_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas(ref _sesion, "Informes/Reportes/Operativos/Ventas/Remisiones.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_Remision);
        }

        private void Button_Ventas_Facturas_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas(ref _sesion, "Informes/Reportes/Operativos/Ventas/Facturas_Clientes.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_FacturaCliente);
        }

        private void Button_Ventas_Devoluciones_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas(ref _sesion, "Informes/Reportes/Operativos/Ventas/Devoluciones.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_DevolucionCliente);
        }

        private void Button_Compras_CotizacionCompras_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Compras(ref _sesion, "Informes/Reportes/Operativos/Compras/Cotizaciones_Compras.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_CotizacionCompra);
        }

        private void Button_Compras_OrdenesCompras_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Compras(ref _sesion, "Informes/Reportes/Operativos/Compras/OrdenesCompra_Compras.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_OrdenCompra);
        }

        private void Button_Compras_Recepciones_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Compras(ref _sesion, "Informes/Reportes/Operativos/Compras/Recepciones_Compras.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_Recepcion);
        }

        private void ButtonFacturasProveedor_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Compras(ref _sesion, "Informes/Reportes/Operativos/Compras/Facturas_Proveedores_Compras.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_FacturaProveedor);
        }

        private void Button_Compras_DevolucionProveedor_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Compras(ref _sesion, "Informes/Reportes/Operativos/Compras/Devoluciones_Compras.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_DevolucionProveedor);
        }

        private void Button_Ventas_Clientes_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas_Cliente(ref _sesion, "Informes/Reportes/Operativos/Ventas/Clientes.rdlc");
        }
       
        private void Button_CRM_Prospectos_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas_Cliente(ref _sesion, "Informes/Reportes/Operativos/CRM/Prospectos.rdlc");
        }

        private void Button_Compras_Proveedores_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas_Cliente(ref _sesion, "Informes/Reportes/Operativos/Compras/Proveedor_Compras.rdlc");
        }

        private void Button_CRM_Actividades_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_CRM_Actividad(ref _sesion, "Informes/Reportes/Operativos/CRM/Actividades.rdlc");
        }

        private void Button_Bancos_Transferencias_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Bancos_Transferencias(ref _sesion, "Informes/Reportes/Operativos/Bancos/Transferencia_Cuentas.rdlc");
        }

        private void Button_Inventarios_TraspasosAlmacen_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Inventarios_Traspasos(ref _sesion, "Informes/Reportes/Operativos/Inventarios/TraspasoAlmacen.rdlc");
        }

        private void Button_Inventarios_MovInventarios_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Inventarios_Movimientos(ref _sesion, "Informes/Reportes/Operativos/Inventarios/MovsInventario.rdlc");
        }

        private void Button_Bancos_MovBancarios_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Bancos_MovBancarios(ref _sesion, "Informes/Reportes/Operativos/Bancos/Movimientos_Bancarios.rdlc");
        }

        private void Button_Inventarios_Articulos_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Inventarios_Articulos(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Articulos.rdlc");
        }
        
        private void Button_Ventas_NotasCredito_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Ventas(ref _sesion, "Informes/Reportes/Operativos/Ventas/Notas_Credito.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_NotaCreditoCliente);
        }

        private void Button_Compras_NotasCreditoProveedor_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Compras(ref _sesion, "Informes/Reportes/Operativos/Compras/Notas_Credito_Compras.rdlc", SIIE_ERP.BaseDatos.Documentos_Id.Doc_NotaCreditoProveedor);
        }
        private void Button_PuntoVenta_Tickets_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_PuntoVenta_Tickets(ref _sesion, "Informes/Reportes/Operativos/Punto_Venta/Tickets.rdlc");
        }
        private void Button_CRM_Oportunidades_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_CRM_Oportunidades(ref _sesion, "Informes/Reportes/Operativos/CRM/Oportunidades.rdlc");
        }
        private void Button_PuntoVenta_VentaTA_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_PuntoVenta_Tickets(ref _sesion, "Informes/Reportes/Operativos/Punto_Venta/Tickets_TA.rdlc");
        }
        private void Button_PuntoVenta_ReimpresionTickets_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_PuntoVenta_Reimpresion(ref _sesion, "Informes/Reportes/Operativos/Ventas/Reimpresion.rdlc");
        }
        private void Button_Inventarios_Kits_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Inventarios_Articulos(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Kits.rdlc");
        }
        private void Button_Ventas_AntiguedadSaldosCxC_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Ventas/AntiguedadSaldoCXC.rdlc");
        }
        private void Button_Compras_AntiguedadSaldosCxP_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new GenericReport(ref _sesion, "Informes/Reportes/Operativos/Compras/AntiguedadSaldoCXC_Compras.rdlc");
        }
        private void Button_Bancos_PagosClientes_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Bancos_Pagos(ref _sesion, "Informes/Reportes/Operativos/Bancos/Pagos_Cliente.rdlc");
        }
        private void Button_Bancos_PagosProveedores_Click(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Bancos_Pagos_Proveedor(ref _sesion, "Informes/Reportes/Operativos/Bancos/Pagos_Proveedor.rdlc");
        }
        private void Button_Inventarios_NuevoReporteExistencias_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Inventarios_NuevoReporteExistencias(ref _sesion, "Informes/Reportes/Operativos/Inventarios/NuevoReporteExistencias.rdlc");
        }
        private void Button_Inventarios_MovInventariosPorArticulo_Click_1(object sender, RoutedEventArgs e)
        {
            Viewbox Aux = (Viewbox)this.Parent;
            Aux.Child = null;
            Aux.Child = new Seleccion_Inventarios_MovimientosPorArticulo(ref _sesion, "Informes/Reportes/Operativos/Inventarios/MovsInventario.rdlc");
        }















        


        private void Button_Inventarios_Existencias_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Window window = new System.Windows.Window
            {
                Title = "Costos de Inventario",
                Content = new ScrollViewer() { 
                    Content = new Seleccion_Inventarios_Existencias(ref _sesion, true),
                    HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
                    VerticalScrollBarVisibility = ScrollBarVisibility.Auto
                },
                Height = 585,
                Width = 1335,
                WindowStyle = System.Windows.WindowStyle.ToolWindow,
                ResizeMode = ResizeMode.CanResize,
                WindowState = WindowState.Normal,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                Icon = new BitmapImage(new Uri("pack://application:,,,/Imagenes/SIE.ico")),
            };

            window.Show();

            //Viewbox Aux = (Viewbox)this.Parent;
            //Aux.Child = null;
            //Aux.Child = new Seleccion_Inventarios_Existencias(ref _sesion);
        }
        private void Button_Ventas_AnalisisVentas_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Window window = new System.Windows.Window
            {
                Title = "Análisis de Ventas",
                Content = new ScrollViewer()
                {
                    Content = new Seleccion_Ventas_GraficaMaster(ref _sesion, true),
                    HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
                    VerticalScrollBarVisibility = ScrollBarVisibility.Auto
                },
                Height = 585,
                Width = 1335,
                WindowStyle = System.Windows.WindowStyle.ToolWindow,
                ResizeMode = ResizeMode.CanResize,
                WindowState = WindowState.Normal,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                Icon = new BitmapImage(new Uri("pack://application:,,,/Imagenes/SIE.ico")),
            };

            window.Show();

            //Viewbox Aux = (Viewbox)this.Parent;
            //Aux.Child = null;
            //Aux.Child = new Seleccion_Ventas_GraficaMaster(ref _sesion);
        }
        private void Button_Compras_AnalisisCompras_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Window window = new System.Windows.Window
            {
                Title = "Análisis de Compras",
                Content = new ScrollViewer()
                {
                    Content = new Seleccion_Compras_GraficaMaster(ref _sesion, true),
                    HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
                    VerticalScrollBarVisibility = ScrollBarVisibility.Auto
                },
                Height = 585,
                Width = 1335,
                WindowStyle = System.Windows.WindowStyle.ToolWindow,
                ResizeMode = ResizeMode.CanResize,
                WindowState = WindowState.Normal,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                Icon = new BitmapImage(new Uri("pack://application:,,,/Imagenes/SIE.ico")),
            };

            window.Show();

            //Viewbox Aux = (Viewbox)this.Parent;
            //Aux.Child = null;
            //Aux.Child = new Seleccion_Compras_GraficaMaster(ref _sesion);
        }
        private void Button_CRM_Pipeline_Click_1(object sender, RoutedEventArgs e)
        {
            System.Windows.Window window = new System.Windows.Window
            {
                Title = "Pipeline",
                Content = new ScrollViewer()
                {
                    Content = new Seleccion_CRM_Pipeline(ref _sesion, true),
                    HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
                    VerticalScrollBarVisibility = ScrollBarVisibility.Auto
                },
                Height = 585,
                Width = 1335,
                WindowStyle = System.Windows.WindowStyle.ToolWindow,
                ResizeMode = ResizeMode.CanResize,
                WindowState = WindowState.Normal,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                Icon = new BitmapImage(new Uri("pack://application:,,,/Imagenes/SIE.ico")),
            };

            window.Show();

            //Viewbox Aux = (Viewbox)this.Parent;
            //Aux.Child = null;
            //Aux.Child = new Seleccion_CRM_Pipeline(ref _sesion);
        }

        private void Button_Compras_AnalisisPrecios_Click_1(object sender, RoutedEventArgs e)
        {
            System.Windows.Window window = new System.Windows.Window
            {
                Title = "Análisis de Precios de Compras",
                Content = new ScrollViewer()
                {
                    Content = new Seleccion_Compras_AnalisisPrecios(ref _sesion, true),
                    HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
                    VerticalScrollBarVisibility = ScrollBarVisibility.Auto
                },
                Height = 585,
                Width = 1335,
                WindowStyle = System.Windows.WindowStyle.ToolWindow,
                ResizeMode = ResizeMode.CanResize,
                WindowState = WindowState.Normal,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                Icon = new BitmapImage(new Uri("pack://application:,,,/Imagenes/SIE.ico")),
            };

            window.Show();

            //Viewbox Aux = (Viewbox)this.Parent;
            //Aux.Child = null;
            //Aux.Child = new Seleccion_Compras_AnalisisPrecios(ref _sesion);
        }

        



        
        












        
        
        

        

        


        


        

        
    }
}
